<?php

namespace support\spark\plugin\helpers;

class Uninstall
{

    public  static  function  execute($name){
        $class = "\\plugin\\$name\\api\\Install";
        if (!method_exists($class, 'uninstall')) {
            throw new \RuntimeException("Method $class::uninstall not exists");
        }
        call_user_func([$class, 'uninstall'], config("plugin.$name.app.version"));
        return true;
    }
}